<table width="100%" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td></td>
      </tr>
    </table>
    <!--  -->

      <table class="bdcolor" width="100%" height="100" border="0" align="center" cellpadding="0" cellspacing="0" >
        <tr >
          <td valign="top" class="bdcol"><table width="190" height="24" border="0" align="center" cellpadding="0" cellspacing="0">

          </table>
          <table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td background="images/dh_back_1.gif">&nbsp;&nbsp;</td>
            <td background="images/dh_back_1.gif">&nbsp;&nbsp;</td>
          </tr>
        </table>
            <table width="180" height="80" border="0" align="center" cellpadding="0" cellspacing="0" >
                <tr align="center">
                  <td>
                      <p style="font-size:22px;color:white;">欢迎光临</p>
                    <p id="welcome" style="font-size:22px;color:white;"><?php echo $_COOKIE['user']?></p>
                  </td>
                </tr>
                <tr align="right">
                  <td>
                    <span id="welcome"><a href="/cookie_null.php" style="text-decoration:none;color:FFF">退出&nbsp;&nbsp;</a></span>
                  </td>
                </tr>
                <tr height="20px">
                  <td>

                  </td>
                </tr>

            </table>

          </td>
        </tr>

      </table>
      <!--  -->
      <!-- <table width="100%" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
      </table> -->

      <!-- <table width="100%" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
      </table> -->

<table class="bdcolor" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top" class="bdcol">
            <table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0" >
              <tr align="center">
                <td class="title" background="images/dh_back_1.gif">小区名称</td>
              </tr>
          </table>
            <table width="150" height="44" border="0" align="right" cellpadding="0" cellspacing="0">
                <tr height="20px">
                  <td>

                  </td>
                </tr>
                  <tr align="left">

                    <td><a style="text-decoration:none;color:white;font-size:16px" href="./index.php?groupID=2">角门东里</a></td>
                  </tr>
                  <tr height="20px">
                    <td>

                    </td>
                  </tr>
            </table></td>
        </tr>
</table>
<!-- <table width="100%" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="100%" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table> -->

<table class="bdcolor" width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr >
    <td valign="top" class="bdcol" >
    <table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr align="center">
          <td class="title" background="images/dh_back_1.gif">小区住户</td>
        </tr>
    </table>
      <table  height="44" border="0" align="right" cellpadding="3" cellspacing="0" >
          <tr height="10px">
            <td width="150">

            </td>
            <td width="70">

            </td>
          </tr>
          <?php foreach($datas as $k=>$v){ ?>
            <tr align="left" >
              <td id="td1" style="height:40px">
                  <span id="yuan<?php echo $k; ?>" style="padding-right:15px;"><img src="http://www.laoyou1.me/version1.3/img/yuan.png"  width="10px" alt="" style="position:relative;top:-2px"></span>
                <a style="text-decoration:none;color:white;font-size:16px" onclick="dianji(this);" id="dianji" href="./index.php?id=new&gatename=<?php echo $v['name']?>&did=<?php echo $v['did']?>&groupID=<?php echo empty($_GET['groupID']) ? '2':$_GET['groupID']?>">
                  <span id="name<?php echo $k;?>" style="font-weight:<?php
                      if($v['did'] == $_GET['did']){
                          echo 'bold';
                      }else{
                          echo 'normal';
                      }
                      ?>;font-size:22px;color:<?php if ($v['did'] == $_GET['did']){echo '#14bb9f';}else{echo 'white';}?>">
                      <?php echo $v['name']?>
                  </span>

                  <input id="inputd<?php echo $k; ?>" type="hidden" name="" value="<?php echo $v['did'];?>">

                </a>
                <input id="inname<?php echo $k; ?>" placeholder="不超过7个字" maxlength="7" type="hidden" name="" value="">
              </td>
              <td>

                  <!-- <input id="buname<?php echo $k; ?>" class="inputname" type="button" name="" value="修改名称" onclick="upname( <?php echo $k;?> )"> -->
                  <img id="buname<?php echo $k; ?>" style="cursor: pointer" src="http://www.laoyou1.me/version1.3/img/bianji.png" width="25px" title="点击修改名称" onclick="upname( <?php echo $k;?> )">
                  <input id="baocunname<?php echo $k; ?>" class="inputname" type="hidden" name="" value="保存" onclick="formname(<?php echo $k; ?>)">
                  <input id="qxname<?php echo $k; ?>" class="inputname" type="hidden" name="" value="取消" onclick="qxname( <?php echo $k;?> )">
              </td>

            </tr>
            <?php }  ?>
            <!-- <tr align="left" onclick="add_from()">
              <td><span style="font-size:20px;color:#14bb9f">添加住户</span></td>


            </tr> -->
            <tr height="20px">
              <td>

              </td>
            </tr>
      </table></td>
  </tr>

</table>

      <table width="100%" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
      </table>
      <script type="text/javascript">
      function sub_from(){

          var did = $('#did_hao').val();
          var name = $('#name_hao').val();
          if( did.length != 4 )
          {
              alert( '设备号输入有误' );
              return;
          }
          if( name.length == 0 )
          {
              alert( '名称输入有误' );
              return;
          }
          var group = '2';
          var methods = new GetDataJSON();
          methods.Subfrom( did , name , group );
          // alert( did );
          // alert( name );
      }
          function upname(e)
          {
            //  alert(e);
             $('#inname'+e).attr('type','text');
             $('#name'+e).css('display','none');
             $('#yuan'+e).css('display','none');
             $('#buname'+e).css('display','none');
            //  $('#buname'+e).attr('type','hidden');
             $('#baocunname'+e).attr('type','button');
             $('#qxname'+e).attr('type','button');
          }
          function formname(e)
          {
              var mod = 1;
              var _name = $('#inname'+e).val();//新名称
              var _did = $('#inputd'+e).val();//新名称
            //   alert(did);
              if( (_name.length >=1) && ( _name.length<=7 )){

              }else{
                  alert('您输入的昵称长度不正确');
                  mod = 0;
              }
              if( mod == 1 ){
                    var url = "http://www.laoyou1.me/shhomer/output/changeGateInfo_pc.php";
                    var para = { did: _did , name:_name , order:e};
                    $.get(url, para, function (data) {
                        if (typeof (callback) != 'object')
                        {
                            console.log( data);
                        if( data.Status == 'SUCCESS')
                        {
                            $('#name'+data.Message).text(data.Data);
                        }else{
                            alert( data.Message );

                        }
                        }
                    }, "json");
              }
              $('#inname'+e).attr('type','hidden');
              $('#name'+e).css('display','');
              $('#yuan'+e).css('display','');
            //   $('#buname'+e).attr('type','button');
              $('#buname'+e).css('display','');
              $('#baocunname'+e).attr('type','hidden');
              $('#qxname'+e).attr('type','hidden');


          }
          function qxname(e)
          {
              $('#inname'+e).attr('type','hidden');
              $('#name'+e).css('display','');
              $('#yuan'+e).css('display','');
            //   $('#buname'+e).attr('type','button');
              $('#buname'+e).css('display','');
              $('#baocunname'+e).attr('type','hidden');
              $('#qxname'+e).attr('type','hidden');
          }
      </script>
